import gevent
import time
from gevent import monkey
monkey.patch_all()
def f(n):
    for i in range(n):
        print(f'{i}===>',gevent.getcurrent(),i)
        gevent.sleep(0.5)

def f1(n):
    for i in range(n):
        print(f'{i}===>',gevent.getcurrent(),i)
        gevent.sleep(0.5)

def f2(n):
    for i in range(n):
        print(f'{i}===>',gevent.getcurrent(),i)
        gevent.sleep(0.5)



gevent.sleep(1)
g1=gevent.spawn(f,5)
gevent.sleep(1)
g2=gevent.spawn(f1,5)
gevent.sleep(1)
g3=gevent.spawn(f2,5)
g1.join()
g2.join()
g3.join()
